-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Generate phase" fetching uids and gids according to the build context #26
"Generate phase" fetching uids and gids according to the build context #26
Conversation
1bc3cbe
to
38f22db
Compare
f488259
to
4b2d60c
Compare
generate.go
Outdated
return DuringBuildPermissionsGetter{get_etc_passwd_file_content: epfg} | ||
} | ||
|
||
func Generate(dependencyManager DependencyManager, logger scribe.Emitter, duringBuildPermissionsGetter DuringBuildPermissionsGetter) packit.GenerateFunc { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if it would be simpler/cleaner to
- Just pass in the UID and GUID in a structure to Generate. The tests would just hard code those values when testing Generate
- Make the function to get the UID and GUID from the password file take a filename. We could then add tests which used a dummy password file(s) in the test directories to validate the functionality of reading extracting the UIDs and GUIDs
- Update main.go to simply call the function to get the UID and GUID with /etc/passwd and call Generate with the structure returned?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…t user permissions
4b2d60c
to
dd38c12
Compare
85c805e
to
49110a4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Merge After
Summary
During the generate phase, we build the
build
and therun
image for the build phase and for the runtime. At the moment, the uid and gid of thebuild
andrun
image are hardcoded inside the/bin/generate
ubi-nodejs-extension/generate.go
Lines 22 to 23 in 7caa04e
build
andrun
images, the uid and gid that thecnb
user has on the current context that the app is being built. This approach is preferable as it also matches the uid and gids we specify on this PR paketo-community/ubi-base-stack#22The implementation of this pr is as follows:
uids
andgids
inside thegenerate
binary, we fetch theuid
andgid
of the cnb user from theetc/passwd
file.Use Cases
Checklist